package com.atguigu.ggkt.vod.controller;

import com.atguigu.ggkt.swagger.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;
@Api("登录管理")
//@CrossOrigin
@RestController
@RequestMapping("/admin/vod/user")
public class LoginController {
    /**
     * 用户登录
     * @return
     */
    @ApiOperation("用户登录")
    @PostMapping("/login")
    public Result login(){
        Map<String,Object> map = new HashMap<>();
        map.put("token","admin-token");
        return Result.ok(map);
    }

    /**
     * 用户信息
     * @return
     */
    @ApiOperation("用户信息")
    @GetMapping("/info")
    public Result info(){
        Map<String,Object> map = new HashMap<>();
        map.put("avater"
                ,"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        map.put("introduction","I am a super administrator");
        map.put("name","Super Admin");
        map.put("roles","admin");
        return Result.ok(map);
    }

}

